Skip to content

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jan 19, 2024

I noticed this while working on #78658

I noticed this while working on llvm#78658
@llvmbot
Copy link
Member

llvmbot commented Jan 19, 2024

@llvm/pr-subscribers-lld-elf

@llvm/pr-subscribers-lld

Author: Sam Clegg (sbc100)

Changes

I noticed this while working on #78658


Full diff: https://github.com/llvm/llvm-project/pull/78659.diff

1 Files Affected:

  • (modified) lld/ELF/Driver.cpp (+1-7)
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 5ccc65600dcb91..07f4263c90e62b 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -2081,13 +2081,7 @@ static void handleUndefinedGlob(StringRef arg) {
 
 static void handleLibcall(StringRef name) {
   Symbol *sym = symtab.find(name);
-  if (!sym || !sym->isLazy())
-    return;
-
-  MemoryBufferRef mb;
-  mb = cast<LazyObject>(sym)->file->mb;
-
-  if (isBitcode(mb))
+  if (sym && sym->isLazy() && isa<BitcodeFile>(sym->file))
     sym->extract();
 }
 

@sbc100 sbc100 requested a review from MaskRay January 19, 2024 02:16
Copy link
Member

@MaskRay MaskRay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think this opportunity is enabled by my previous change removing LazyArchive https://reviews.llvm.org/D119074

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants